<div class="container-fluid" style="padding: 20px 10px 0px 10px">
    <div class="row-fluid">
        <div class="well">
            <ul class="nav nav-tabs">
                <li class="active"><b>添加药品种类</b></li>
            </ul>
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane active in" id="home">
                    <form id="formid" action="/drug/addDrugKind" method="post">
                        <p>名称：<input type="text" value="<?=$getData['drug_name']?>" name="drug_name" style="width:200px;margin-left: 28px;"></p>
                        <!--<p>种类：<input type="text" value="<?=$getData['type']?>" name="type" style="width:200px;margin-left: 28px;"></p>-->
                        <p class="block-mb15">种类：
								<select name="type" id="type" style="margin-left:24px;width:215px;">
									<option value="">请选择</option>
                                    <?php if($kinds){foreach($kinds as $k=>$v){?>
									<option value="<?=$v?>" <?php if($getData['type'] == $v){echo 'selected';}?>><?=$v?></option>
                                    <?php }}?>
								</select>
						</p>
                        <p>编号：<input type="text" value="<?=$getData['drug_no']?>" name="drug_no" style="width:200px;margin-left: 28px;"></p>
                        <p>规则型号：<input type="text" value="<?=$getData['drug_size']?>" name="drug_size" style="width:200px;"></p>
                        <p>单位：<input type="text" value="<?=$getData['drug_unit']?>" name="drug_unit" style="width:200px;margin-left: 28px;"></p>

                        <input type="hidden" value="1" name="dosubmit" />
                        <input type="hidden" value="<?=$getData['id']?>" name="id" />
                    </form>
                </div>
                <div class="btn-toolbar">
                    <button class="btn btn-primary" id="btn-save" style="margin-left:72px;margin-top:20px"><i class="icon-save"></i> 保存</button>
                    <div class="btn-group">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function(){
        $('#btn-save').click(function(){
            if($('input[name="drug_name"]').val() == ''){
                showmsg('药品名称不能为空！');
            }else if($("#type option:selected").val() == ''){
                showmsg('请选择药品种类');
            }else if($('input[name="drug_no"]').val() == ''){
                showmsg('请填写药品编号');
            }else if($('input[name="drug_size"]').val() == ''){
                showmsg('请填写药品规则型号');
            }else if($('input[name="drug_unit"]').val() == ''){
                showmsg('请填写药品单位');
            }else{
                setBtn($('#btn-save'));
                $('#formid').submit();
            }
        });
    })
</script>